my $startDate = $ARGV[0];
my $endDate = $ARGV[1];

for ($i = $startDate; $i <= $endDate; ++$i){
	$file = sprintf("./input/8010-2013-01-%02d.dat", $i);
	$cmd1 = "extract_c5_new.pl $file";
	print $cmd1, "\n";
	if (system("extract_c5_new.pl $file") != 0)
	{
		print "error cmd1\n";
		next;
	}
	$cmd2 = "lostPacket.pl $file";
	if (system($cmd2) != 0){
		print "error cmd2\n";
		next;
	}
	$cmd3 = "traceLostPacket2.pl";
	if (system($cmd3) != 0){
		print "error cmd3\n";
		next;
	}
	$cmd4 = "lostPacketDis.pl ./output/AllLostPackets.dat";
	system($cmd4);
	$cmd5 = "move .\\output\\AllLostPacketsTimeMat.dat .\\output\\AllLostPacketsTimeMat$i.dat";
	system($cmd5);
	$cmd6 = "move .\\output\\LostCauses.dat .\\output\\LostCauses$i.dat";
	system($cmd6);

}